import {defineConfig, loadEnv} from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'


export default defineConfig(({command, mode}) => {
    const env = loadEnv(mode, process.cwd())
    return {
        plugins: [vue()],
        base: env.VITE_PUBLIC_PATH,
        resolve: {
            alias: {
                '@': path.resolve(__dirname, 'src'),
            }
        },
        css: {
            preprocessorOptions: {
                scss: {
                    api: 'modern-compiler',
                    additionalData: `@use '@/styles/variables' as *;`,
                }
            },
        }
    }
})
